# 启用 virtio-fs 相关配置
export CONFIG_VIRTIO_FS=m
export CONFIG_FUSE_FS=m
export CONFIG_VIRTIO_PCI=m
export CONFIG_FAILOVER=m
export CONFIG_VIRTIO_BLK=m
export CONFIG_DMA_VIRTUAL_CHANNELS=m
export CONFIG_VIRTIO_MMIO=m
export CONFIG_VIRTIO_NET=m
export CONFIG_VIRTIO=m
export CONFIG_NET_FAILOVER=m

# 编译 virtio-fs 相关模块
obj-m = fs/fuse/ drivers/virtio/ drivers/block/ drivers/net/

ARCH=arm64
MODULE_MAKE=${PWD}
MACRO=ARM64_HI1711_ENABLED
KBUILD_CFLAGS += -D${MACRO}
$(info ${KBUILD_CFLAGS})

all:
	make ARCH=${ARCH} CROSS_COMPILE=${CROSS_COMPILE} -C ${KERNEL_PATH} M=${MODULE_MAKE} KBUILD_EXTRA_SYMBOLS=${KBUILD_EXTRA_SYMBOLS} modules

clean:
	make ARCH=${ARCH} CROSS_COMPILE=${CROSS_COMPILE} -C ${KERNEL_PATH} M=${MODULE_MAKE} clean